import { createRequest } from '/@/api/service';
const module = 'ib/archive/v1/ArchiveChangeReceiveApi/';

/**
 * @function 领用归还——列表查询
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_RECEIVE_LIST(
  data: ArchiveChangeReceiveApi.QueryChangeReceiveListReq,
  header: object = {},
): Promise<ArchiveChangeReceiveApi.QueryChangeReceiveListResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeReceiveList`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 领用归还——新增领用
 * @param data
 * @param header
 * @returns
 */
function INSERT_CHANGE_RECEIVE(
  data: ArchiveChangeReceiveApi.InsertChangeReceiveReq,
  header: object = {},
): Promise<ArchiveChangeReceiveApi.InsertChangeReceiveResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}insertChangeReceive`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 领用归还—查看详情
 * @param data
 * @param header
 * @returns
 */
function QUERY_CHANGE_RECEIVE_DETAIL(
  data: ArchiveChangeReceiveApi.QueryChangeReceiveDetailReq,
  header: object = {},
): Promise<ArchiveChangeReceiveApi.QueryChangeReceiveDetailResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryChangeReceiveDetail`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 领用归还—确认归还
 * @param data
 * @param header
 * @returns
 */
function RETURN_CHANGE_RECEIVE_DETAIL(
  data: ArchiveChangeReceiveApi.ReturnChangeReceiveReq,
  header: object = {},
): Promise<ArchiveChangeReceiveApi.ReturnChangeReceiveResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}returnChangeReceive`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 领用归还——领用审批
 * @param data
 * @param header
 * @returns
 */
function APPROVAL_CHANGE_RECEIVE(
  data: ArchiveChangeReceiveApi.ApprovalChangeReceiveReq,
  header: object = {},
): Promise<ArchiveChangeReceiveApi.ApprovalChangeReceiveResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}approvalChangeReceive`,
    data,
    header,
    'POST',
  );
}

export {
  QUERY_CHANGE_RECEIVE_LIST,
  INSERT_CHANGE_RECEIVE,
  QUERY_CHANGE_RECEIVE_DETAIL,
  RETURN_CHANGE_RECEIVE_DETAIL,
  APPROVAL_CHANGE_RECEIVE,
};
